﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="reportspage_access.aspx.cs" Inherits="User_UserAccess_reportspage_access" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager runat="server" ID="smgrUser" EnablePartialRendering="true">
    </asp:ScriptManager>
    <div class="contents">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td colspan="2">
                    <h1>
                        Reports Pages User Access</h1>
                </td>
            </tr>
            <tr id="trSearch" runat="server">
                <td width="950">
                    <b>User</b> :
                    <asp:DropDownList ID="ddlUser" runat="server" AutoPostBack="true" 
                        onselectedindexchanged="ddlUser_SelectedIndexChanged"></asp:DropDownList>
                    &nbsp;<b>Reports</b> :
                    <asp:DropDownList ID="ddlReports" runat="server" AutoPostBack="true" 
                        onselectedindexchanged="ddlReports_SelectedIndexChanged"></asp:DropDownList>
                    <asp:Button ID="ibtnGetAccess" Text="Submit" runat="server" Visible="false" />
                    </span>
                </td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                    <h3>
                        Page Access Details</h3>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="grvUserAccess" runat="server" AllowPaging="False" AllowSorting="True"
                        AutoGenerateColumns="False" CellPadding="2" CssClass="progridstyle" EmptyDataText="There are no data records to display."
                        GridLines="None" DataKeyNames="PageId" DataSourceID="sqlDsPages" 
                        onrowdatabound="grvUserAccess_RowDataBound" >
                        <FooterStyle />
                        <PagerStyle />
                        <Columns>
                            <asp:TemplateField HeaderText="PageId" Visible="false">
                                <ItemTemplate>
                                        <asp:Label ID="lblPageId" runat="server" Text='<%# Eval("PageId").ToString()%>'></asp:Label> 
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="PageName" HeaderText="Page Name" ItemStyle-Width="300px" />
                            <asp:BoundField DataField="PageCode" HeaderText="Page Code" Visible="false" />
                            <asp:TemplateField HeaderText="User Access">
                                <ItemTemplate>
                                         <asp:DropDownList ID="ddlUserAccess" runat="server" Width="200px">
                                            <asp:ListItem Value="0">Not Accessible</asp:ListItem>
                                            <asp:ListItem Value="100">View</asp:ListItem>
                                         </asp:DropDownList>
                                </ItemTemplate>
                            </asp:TemplateField> 
                            <asp:BoundField DataField="OptionId" HeaderText="OptionId" Visible="false" />
                        </Columns>
                        <FooterStyle />
                        <PagerStyle />
                        <SelectedRowStyle />
                        <HeaderStyle CssClass="admin_gridheader" />
                        <EditRowStyle />
                        <AlternatingRowStyle CssClass="admin_gridodd" />
                        <RowStyle CssClass="admin_grideven" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="sqlDsPages" runat="server" ConnectionString="<%$ ConnectionStrings:GGR_DB_ReportConnectionString %>"
                        SelectCommand="sprocCXTHReportsPagesSelectItemList" SelectCommandType="StoredProcedure">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="ddlReports" Name="PageType" PropertyName="SelectedValue" Type="String" />
                            </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
                </td>
            </tr>
        </table>
    </div>
</asp:Content>

